package Kuaishou;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import com.google.common.collect.Sets;

/**
 * @author leiwenkang <leiwenkang@kuaishou.com>
 * Created on 2020-10-19
 */
public class Test08集合类取交集 {
    public static void main(String[] args) {

        Set<Long> list1 = Sets.newHashSet(1L, 2L, 3L, 4L);
        Set<Long> list2 = Sets.newHashSet(2L, 3L, 4L, 5L);
        list1.retainAll(list2);
        System.out.println(list1);
        System.out.println(list2);
    }

}
